package cn.hanyx.coder.design.pattern.behavioral.strategy.demo01;

import java.util.HashMap;
import java.util.Map;

/**
 * SortFactory
 *
 * @author hanyx
 * @date 2020/06/04
 */
public class SortFactory {
    private static Map<String, ISortAlg> map = new HashMap<>();

    static {
        map.put("EoncurrentExternal", new EoncurrentExternalSort());
        map.put("External", new ExternalSort());
        map.put("Mapreduce", new MapreduceSort());
        map.put("Quick", new QuickSort());
    }



    public static ISortAlg getInstance(String key) {
        return map.get(key);
    }
}
